<script lang="ts" setup>
import { reactive, ref, watch } from "vue"
import { createComboDataApi, updateComboDataApi, getComboDataApi, deleteComboDataApi, upOrDwon } from "@/api/combo-h5"
import { type IGetComboData } from "@/api/combo/types/combo"
import { type FormInstance, type FormRules, ElMessage, ElMessageBox } from "element-plus"
import { Search, Refresh, CirclePlus, Download, RefreshRight } from "@element-plus/icons-vue"
import { usePagination } from "@/hooks/usePagination"
import { Plus } from "@element-plus/icons-vue"
import { uploadComboImageList } from "@/api/combo"
import { useCommonStore } from "@/store/modules/common"
defineOptions({
  name: "ComboH5List"
})
const fileList = ref<any>([]) /**背景图片列表 */
const fileList1 = ref<any>([]) /**主图片列表 */
const fileList2 = ref<any>([]) /**固定图片列表 */
// const userStore = useUserStore()
const commonStore = useCommonStore()
const loading = ref<boolean>(false)
const { paginationData, handleCurrentChange, handleSizeChange } = usePagination()
//#region 增
const dialogVisible = ref<boolean>(false)
const formRef = ref<FormInstance | null>(null)
const formData = reactive<any>({ data: {} })
const formRules: FormRules = reactive({
  name: [{ required: true, trigger: "blur", message: "请输入套餐名称" }],
  // systemId: [{ required: true, trigger: "blur", message: "请选择对应套餐" }],
  operator: [{ required: true, trigger: "blur", message: "请选择运营商" }],
  photo: [{ required: true, trigger: "blur", message: "请选择是否上传身份证" }]
})

//合集套餐
import { getCompailationDataApi } from "@/api/combo"
const switchValue = ref<any>(false)
const comboHJList = ref<any>([])
const getComboHjList = () => {
  getCompailationDataApi({
    page: 1,
    size: 1000
  })
    .then((res: any) => {
      comboHJList.value = res.data.list
    })
    .catch(() => {
      comboHJList.value = []
    })
}
getComboHjList()
const changeComboType = () => {
  formData.data.systemId = ""
  formData.data.heId = ""
}

const handleAdd = () => {
  dialogVisible.value = true
}
const handleCreate = () => {
  formRef.value?.validate((valid: boolean) => {
    if (valid) {
      uploadFuc()
    } else {
      return false
    }
  })
}

//#endregion

//#region 删
const handleDelete = (row: any) => {
  ElMessageBox.confirm(`正在删除套餐：${row.name}，确认删除？`, "提示", {
    confirmButtonText: "确定",
    cancelButtonText: "取消",
    type: "warning"
  }).then(() => {
    deleteComboDataApi(row.id).then(() => {
      ElMessage.success("删除成功")
      getTableData()
    })
  })
}
//#endregion
//上下架
const handleUpOrDown = (row: any) => {
  ElMessageBox.confirm(`正在${row.status === "0" ? "下架" : "上架"}套餐：${row.name},确认执行？`, "提示", {
    confirmButtonText: "确定",
    cancelButtonText: "取消",
    type: "warning"
  }).then(() => {
    upOrDwon({ id: row.id, status: row.status === "0" ? "1" : "0" }).then(() => {
      ElMessage.success("操作成功")
      getTableData()
    })
  })
}
//#region 改
const currentUpdateId = ref<undefined | string>(undefined)

const handleUpdate = (row: any) => {
  console.log(row)
  currentUpdateId.value = row.id
  formData.data = row
  formData.data.up = row.up
  switchValue.value = !!row.heId
  if (row.image) {
    fileList.value = row.image?.split(",").map((item: any) => {
      return {
        url: `${commonStore.BASEURL}/image/${item}`
        // url: `http://192.168.31.143:8080/image/${item}`
      }
    })
  }
  if (row.picture) {
    fileList1.value = row.picture?.split(",").map((item: any) => {
      return {
        url: `${commonStore.BASEURL}/image/${item}`
        // url: `http://192.168.31.143:8080/image/${item}`
      }
    })
  }
  if (row.fixedImg) {
    fileList2.value = row.fixedImg?.split(",").map((item: any) => {
      return {
        url: `${commonStore.BASEURL}/image/${item}`
        // url: `http://192.168.31.143:8080/image/${item}`
      }
    })
  }

  formData.data.id = currentUpdateId.value
  dialogVisible.value = true
}
//#endregion

//#region 查
const tableData = ref<IGetComboData[]>([])
const searchFormRef = ref<FormInstance | null>(null)
const searchData = reactive({
  name: "",
  sku: "",
  systemId: "",
  state: "true",
  status: "0"
  // team: userStore.teamName ? userStore.teamName : ""
})
const getTableData = () => {
  loading.value = true
  getComboDataApi({
    page: paginationData.currentPage,
    size: paginationData.pageSize,
    name: searchData.name,
    systemId: searchData.systemId,
    status: searchData.status
  })
    .then((res) => {
      paginationData.total = res.data.total
      tableData.value = res.data.list
    })
    .catch(() => {
      tableData.value = []
    })
    .finally(() => {
      loading.value = false
    })
}
const handleSearch = () => {
  if (paginationData.currentPage === 1) {
    getTableData()
  }
  paginationData.currentPage = 1
}
const resetSearch = () => {
  searchFormRef.value?.resetFields()
  if (paginationData.currentPage === 1) {
    getTableData()
  }
  paginationData.currentPage = 1
}
const handleRefresh = () => {
  getTableData()
}
//#endregion
/**套餐详情图上传 */
const handleChageImg = (file: any, resfileList: any) => {
  const size = ref(3)
  const fileSizeFlag = file.size / 1024 / 1024 < size.value
  if (!fileSizeFlag) {
    ElMessage.error(`请上传不大于${size.value}M的图片!`)
    fileList.value = []
  } else {
    fileList.value = resfileList
  }
  //判断图片尺寸是否符合要求
  // new Promise((resolve: any, reject) => {
  //   const img = new Image()
  //   img.src = window.URL.createObjectURL(file.raw)
  //   img.onload = () => {
  //     if (img.width != 750 || img.height < 1500) {
  //       ElMessage.error("请上传宽度为750px并且高度大于1500px的图片！")
  //       fileList.value = []
  //       reject()
  //     } else {
  //       // 尺寸符合要求，可以继续上传
  //       resolve()
  //     }
  //   }
  // })
}
const handleChageImg1 = (file: any, resfileList: any) => {
  const size = ref(3)
  const fileSizeFlag = file.size / 1024 / 1024 < size.value
  if (!fileSizeFlag) {
    ElMessage.error(`请上传不大于${size.value}M的图片!`)
    fileList1.value = []
  } else {
    fileList1.value = resfileList
  }
}
const handleChageImg2 = (file: any, resfileList: any) => {
  const size = ref(3)
  const fileSizeFlag = file.size / 1024 / 1024 < size.value
  if (!fileSizeFlag) {
    ElMessage.error(`请上传不大于${size.value}M的图片!`)
    fileList2.value = []
  } else {
    fileList2.value = resfileList
  }
}

// 预览图片
const dialogImageUrl = ref("") /**预览url  */
const dialogVisible1 = ref(false) /**预览弹窗 */
const dialogImageUrl2 = ref("") /**预览url  */
const dialogVisible2 = ref(false) /**预览弹窗 */
const dialogImageUrl3 = ref("") /**预览url  */
const dialogVisible3 = ref(false) /**预览弹窗 */
const handlePictureCardPreview = (file: any) => {
  dialogImageUrl.value = file.url
  dialogVisible1.value = true
}
const handlePictureCardPreview1 = (file: any) => {
  dialogImageUrl2.value = file.url
  dialogVisible2.value = true
}
const handlePictureCardPreview2 = (file: any) => {
  dialogImageUrl3.value = file.url
  dialogVisible3.value = true
}

// 移除图片
const handleRemove = (file: any) => {
  const list = fileList.value
  for (const i in list) {
    if (list[i].uid === file.uid) {
      list.splice(i, 1)
    }
  }
  fileList.value = list
}
const handleRemove1 = (file: any) => {
  const list = fileList1.value
  for (const i in list) {
    if (list[i].uid === file.uid) {
      list.splice(i, 1)
    }
  }
  fileList1.value = list
}
const handleRemove2 = (file: any) => {
  const list = fileList2.value
  for (const i in list) {
    if (list[i].uid === file.uid) {
      list.splice(i, 1)
    }
  }
  fileList2.value = list
  formData.data.fixedImg = ""
}

//确定上传
const uploadFuc = async () => {
  if (fileList.value.length === 0) {
    ElMessage.error("请上传套餐背景图")
    return
  }
  if (fileList1.value.length === 0) {
    ElMessage.error("请上传套餐头图")
    return
  }
  if (!formData.data.systemId && !formData.data.heId) {
    ElMessage.warning("请选择套餐或者合集套餐！")
    return
  }
  const fileData = new FormData()
  fileList.value.forEach((file: any) => {
    fileData.append("file", file.raw)
  })
  const fileData1 = new FormData()
  fileList1.value.forEach((file: any) => {
    fileData1.append("file", file.raw)
  })
  const fileData2 = new FormData()
  fileList2.value.forEach((file: any) => {
    fileData2.append("file", file.raw)
  })

  if (fileList.value.length && fileList.value[0].status === "ready") {
    await uploadComboImageList(fileData).then((res: any) => {
      if (res.code == 200) {
        formData.data.image = res.data.split("/image/")[1]
      }
    })
  }
  if (fileList1.value.length && fileList1.value[0].status === "ready") {
    await uploadComboImageList(fileData1).then((res: any) => {
      if (res.code == 200) {
        formData.data.picture = res.data.split("/image/")[1]
      }
    })
  }
  if (fileList2.value.length && fileList2.value[0].status === "ready") {
    await uploadComboImageList(fileData2).then((res: any) => {
      if (res.code == 200) {
        formData.data.fixedImg = res.data.split("/image/")[1]
      }
    })
  }
  if (currentUpdateId.value === undefined) {
    await createComboDataApi(formData.data).then((res: any) => {
      if (res.code == 200) {
        ElMessage.success("新增成功")
        dialogVisible.value = false
        fileList.value = []
        fileList1.value = []
        fileList2.value = []
      }

      // getTableData()
    })
  } else {
    await updateComboDataApi(formData.data).then((res: any) => {
      if (res.code == 200) {
        ElMessage.success("修改成功")
        dialogVisible.value = false
        fileList.value = []
        fileList1.value = []
        fileList2.value = []
      }
      // getTableData()
    })
  }
}
/** 监听分页参数的变化 */
watch([() => paginationData.currentPage, () => paginationData.pageSize], getTableData, { immediate: true })
/**监听套餐缓存(pinia) */
import { useComboStore } from "@/store/modules/combo"
const comboStore = useComboStore()
comboStore.getComoboFn()
const comboList = ref<any>([])
const comboList1 = ref<any>([]) //上架的套餐
watch(
  [() => comboStore.comboListStore],
  (newValue) => {
    comboList.value = newValue.flat()
    comboList1.value = newValue.flat().filter((item) => item.state === "true")
  },
  {
    immediate: true
  }
)
/**department END */
// console.log(departTeam.value)

// ** 清除规则报错信息
const clearValidate = () => {
  formRef.value?.clearValidate()
}
const resetForm = () => {
  getTableData()
  currentUpdateId.value = undefined
  formData.data = {}
  fileList.value = []
  fileList1.value = []
  fileList2.value = []
  switchValue.value = false
  clearValidate()
}

const formatterCombo = (row: any, column: any, celValue: any) => {
  comboList.value.filter((item: any) => {
    if (item.id == row.systemId) {
      celValue = item.name
    }
  })
  return celValue
}
const formatterCombo1 = (row: any, column: any, celValue: any) => {
  comboHJList.value.filter((item: any) => {
    if (item.id == row.heId) {
      celValue = item.name
    }
  })
  return celValue
}
const activeName = ref("shelf")
//tabs切换

const handleClick = (tab: any) => {
  paginationData.currentPage = 1
  // console.log(tab.paneName)
  if (tab.paneName == "shelf") {
    searchData.status = "0"
  }
  if (tab.paneName == "offShelf") {
    searchData.status = "1"
  }

  getTableData()
}
</script>

<template>
  <div class="app-container">
    <el-card v-loading="loading" shadow="never" class="search-wrapper">
      <el-form ref="searchFormRef" :inline="true" :model="searchData">
        <el-form-item prop="name" label="套餐名">
          <el-input v-model.trim="searchData.name" placeholder="请输入" />
        </el-form-item>
        <el-form-item prop="systemId" label="系统对应套餐">
          <el-select v-model="searchData.systemId" clearable filterable placeholder="请选套餐" style="width: 240px">
            <el-option v-for="item in comboList" :class="item.state == 'false' ? 'Xjstate' : ''" :key="item.id"
              :label="item.name" :value="item.id + ''" />
          </el-select>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" :icon="Search" @click="handleSearch">查询</el-button>
          <el-button :icon="Refresh" @click="resetSearch">重置</el-button>
        </el-form-item>
      </el-form>
    </el-card>
    <el-card v-loading="loading" shadow="never">
      <div class="toolbar-wrapper">
        <div>
          <el-button type="primary" :icon="CirclePlus" @click="handleAdd">添加套餐</el-button>
        </div>
        <div>
          <el-tooltip content="下载">
            <el-button type="primary" :icon="Download" circle />
          </el-tooltip>
          <el-tooltip content="刷新表格">
            <el-button type="primary" :icon="RefreshRight" circle @click="handleRefresh" />
          </el-tooltip>
        </div>
      </div>
      <div class="table-wrapper">
        <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick" style="display: none">
          <el-tab-pane label="已上架套餐" name="shelf" />
          <el-tab-pane label="已下架套餐" name="offShelf" />
        </el-tabs>
        <el-table :data="tableData">
          <!-- <el-table-column type="selection" width="50" align="center" /> -->
          <el-table-column prop="id" label="ID" width="60" align="center" />
          <!-- <el-table-column prop="teamName" label="团队名" align="center" width="150" /> -->
          <el-table-column prop="photo" label="是否上传身份证" align="center" width="160">
            <template #default="scope">
              <span v-if="scope.row.photo"> 是</span>
              <span v-else>否</span>
            </template>
          </el-table-column>
          <el-table-column prop="isChange" label="是否选号" align="center" width="160">
            <template #default="scope">
              <span v-if="scope.row.isChange"> 是</span>
              <span v-else>否</span>
            </template>
          </el-table-column>
          <el-table-column prop="name" label="套餐名" align="center" />
          <el-table-column label="系统对应套餐" align="center" width="320">
            <template #default="scope">
              <span v-if="scope.row.systemId">{{ formatterCombo(scope.row, "", "") }}</span>
              <span v-else>{{ formatterCombo1(scope.row, "", "") }}</span>
            </template>
          </el-table-column>
          <el-table-column fixed="right" label="操作" width="280" align="center">
            <template #default="scope">
              <el-button type="primary" text bg size="small" @click="handleUpdate(scope.row)">修改</el-button>
              <el-button type="primary" text bg size="small" @click="handleUpOrDown(scope.row)" style="display: none">
                <span v-if="scope.row.status === '0'">下架</span>
                <span v-if="scope.row.status === '1'">上架</span>
              </el-button>
              <el-button style="display: none" type="danger" text bg size="small"
                @click="handleDelete(scope.row)">删除</el-button>
            </template>
          </el-table-column>
        </el-table>
      </div>
      <div class="pager-wrapper">
        <el-pagination background :layout="paginationData.layout" :page-sizes="paginationData.pageSizes"
          :total="paginationData.total" :page-size="paginationData.pageSize" :currentPage="paginationData.currentPage"
          @size-change="handleSizeChange" @current-change="handleCurrentChange" />
      </div>
    </el-card>
    <!-- 新增/修改 -->
    <el-dialog v-model="dialogVisible" :title="currentUpdateId === undefined ? '新增套餐' : '修改套餐'" @close="resetForm"
      width="80%">
      <el-form ref="formRef" :model="formData.data" :rules="formRules" label-width="100px" label-position="left">
        <el-form-item prop="name" label="套餐名">
          <el-input v-model="formData.data.name" placeholder="只对用户端展示" />
        </el-form-item>
        <el-form-item prop="desc" label="套餐描述">
          <el-input v-model="formData.data.desc" placeholder="请输入" type="textarea" />
        </el-form-item>
        <!-- <el-form-item prop="desc" label="套餐标签">
          <el-input v-model="formData.data.tag" placeholder="请输入" />
        </el-form-item> -->
        <!-- <el-form-item prop="sorts" label="排序" style="display: none">
          <el-input v-model="formData.data.sorts" placeholder="请输入数字，1代表该产品排序在第一位" />
        </el-form-item> -->
        <el-form-item prop="systemId" label="系统对应套餐">
          <el-select v-if="!switchValue" v-model="formData.data.systemId" clearable filterable placeholder="请选套餐"
            style="width: 240px">
            <el-option v-for="item in comboList1" :key="item.id" :label="item.name" :value="item.id" />
          </el-select>
          <el-select v-else v-model="formData.data.heId" clearable filterable placeholder="请选合集套餐,可输入快速查询"
            style="width: 240px">
            <!-- :value="item.id + ''" -->
            <el-option v-for="item in comboHJList" :key="item.id" :label="item.name" :value="item.id" />
          </el-select>
          <span style="margin-left: 10px">切换为合集套餐 <el-switch v-model="switchValue" @change="changeComboType" /></span>
        </el-form-item>
        <el-form-item prop="operator" label="运营商">
          <el-select v-model="formData.data.operator" clearable filterable placeholder="请选择" style="width: 240px">
            <el-option :key="1" label="移动" :value="1" />
            <el-option :key="2" label="联通" :value="2" />
            <el-option :key="3" label="电信" :value="3" />
            <el-option :key="4" label="广电" :value="4" />
          </el-select>
        </el-form-item>
        <el-form-item prop="photo" label="上传身份证">
          <el-select v-model="formData.data.photo" clearable filterable placeholder="请选择" style="width: 240px">
            <el-option :key="1" label="是" :value="true" />
            <el-option :key="2" label="否" :value="false" />
          </el-select>
        </el-form-item>
        <el-form-item prop="showFlag" label="在产品集合显示" style="display: none">
          <el-select v-model="formData.data.showFlag" clearable filterable placeholder="请选择" style="width: 240px">
            <el-option :key="1" label="是" value="true" />
            <el-option :key="2" label="否" value="false" />
          </el-select>
        </el-form-item>
        <el-form-item prop="isChange" label="是否选号">
          <el-select v-model="formData.data.isChange" clearable filterable placeholder="请选择" style="width: 240px">
            <el-option :key="1" label="是" :value="true" />
            <el-option :key="2" label="否" :value="false" />
          </el-select>
        </el-form-item>
        <el-form-item prop="picture">
          <template #label>
            <span>H5头图</span>
            <el-tooltip class="box-item" effect="customized" placement="bottom">
              <template #content>
                H5头主图，建议使用正方形图片（不强制），例如 750px*750px 用于产品集合页的缩略图展示
              </template>
              <el-icon style="cursor: pointer">
                <InfoFilled />
              </el-icon>
            </el-tooltip>
          </template>
          <el-upload :auto-upload="false" :file-list="fileList1" :show-file-list="true" list-type="picture-card"
            :limit="1" accept="image/*" :on-change="handleChageImg1" :disabled="fileList1.length != 0">
            <el-icon>
              <Plus />
            </el-icon>
            <template #file="{ file }">
              <div>
                <img class="el-upload-list__item-thumbnail" :src="file.url" />
                <span class="el-upload-list__item-actions">
                  <span class="el-upload-list__item-delete" @click="handleRemove1(file)">
                    <el-icon>
                      <Delete />
                    </el-icon>
                  </span>
                  <span class="el-upload-list__item-preview" @click="handlePictureCardPreview1(file)">
                    <el-icon>
                      <zoom-in />
                    </el-icon>
                  </span>
                </span>
              </div>
            </template>
          </el-upload>
        </el-form-item>
        <el-form-item prop="image">
          <template #label>
            <span>H5背景图</span>
            <el-tooltip class="box-item" effect="customized" placement="bottom">
              <template #content> H5背景图，建议尺寸 宽750px,高度不限 随内容变化 用于产品详情页的详情图 </template>
              <el-icon style="cursor: pointer">
                <InfoFilled />
              </el-icon>
            </el-tooltip>
          </template>
          <el-upload :auto-upload="false" :file-list="fileList" :show-file-list="true" list-type="picture-card"
            :limit="1" accept="image/*" :on-change="handleChageImg" :disabled="fileList.length != 0">
            <el-icon>
              <Plus />
            </el-icon>
            <template #file="{ file }">
              <div>
                <img class="el-upload-list__item-thumbnail" :src="file.url" />
                <span class="el-upload-list__item-actions">
                  <span class="el-upload-list__item-delete" @click="handleRemove(file)">
                    <el-icon>
                      <Delete />
                    </el-icon>
                  </span>
                  <span class="el-upload-list__item-preview" @click="handlePictureCardPreview(file)">
                    <el-icon>
                      <zoom-in />
                    </el-icon>
                  </span>
                </span>
              </div>
            </template>
          </el-upload>
        </el-form-item>
        <el-form-item prop="fixedImg">
          <template #label>
            <span>H5固定图</span>
            <el-tooltip class="box-item" effect="customized" placement="bottom">
              <template #content>
                H5固定图，建议尺寸：宽750px,高度不限
                ，用于页面底部固定（通用）内容，例如标识牌或者其它内容，非必传不需要的可以不上传</template>
              <el-icon style="cursor: pointer">
                <InfoFilled />
              </el-icon>
            </el-tooltip>
          </template>
          <el-upload :auto-upload="false" :file-list="fileList2" :show-file-list="true" list-type="picture-card"
            :limit="1" accept="image/*" :on-change="handleChageImg2" :disabled="fileList2.length != 0">
            <el-icon>
              <Plus />
            </el-icon>
            <template #file="{ file }">
              <div>
                <img class="el-upload-list__item-thumbnail" :src="file.url" />
                <span class="el-upload-list__item-actions">
                  <span class="el-upload-list__item-delete" @click="handleRemove2(file)">
                    <el-icon>
                      <Delete />
                    </el-icon>
                  </span>
                  <span class="el-upload-list__item-preview" @click="handlePictureCardPreview2(file)">
                    <el-icon>
                      <zoom-in />
                    </el-icon>
                  </span>
                </span>
              </div>
            </template>
          </el-upload>
        </el-form-item>
      </el-form>
      <template #footer>
        <el-button @click="dialogVisible = false">取消</el-button>
        <el-button type="primary" @click="handleCreate">确认</el-button>
      </template>
    </el-dialog>
    <el-dialog v-model="dialogVisible1">
      <img w-full :src="dialogImageUrl" alt="Preview Image" />
    </el-dialog>
    <el-dialog v-model="dialogVisible2">
      <img w-full :src="dialogImageUrl2" alt="Preview Image" />
    </el-dialog>
    <el-dialog v-model="dialogVisible3">
      <img w-full :src="dialogImageUrl3" alt="Preview Image" />
    </el-dialog>
  </div>
</template>

<style lang="scss" scoped>
.search-wrapper {
  margin-bottom: 20px;

  :deep(.el-card__body) {
    padding-bottom: 2px;
  }
}

.toolbar-wrapper {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}

.table-wrapper {
  margin-bottom: 20px;
}

.pager-wrapper {
  display: flex;
  justify-content: flex-end;
}

.avatar-uploader .avatar {
  width: 178px;
  height: 178px;
  display: block;
}

.ageInput :deep(.el-input) {
  width: 20% !important;
}

:deep(.el-form-item__label) {
  width: 130px !important;
}

:deep(.el-popper) {
  max-width: 50% !important;
}

:deep(.el-cascader) {
  width: 567px !important;
}

.text-ellipsis {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  line-clamp: 3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
}
</style>
<style>
.avatar-uploader .el-upload {
  border: 1px dashed var(--el-border-color);
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: var(--el-transition-duration-fast);
}

.avatar-uploader .el-upload:hover {
  border-color: var(--el-color-primary);
}

.el-icon.avatar-uploader-icon {
  font-size: 28px;
  color: #8c939d;
  width: 178px;
  height: 178px;
  text-align: center;
}

.el-popper.is-customized {
  /* Set padding to ensure the height is 32px */
  padding: 6px 12px;
  background: linear-gradient(90deg, rgb(159, 229, 151), rgb(204, 229, 129));
}

.el-popper.is-customized .el-popper__arrow::before {
  background: linear-gradient(45deg, #b2e68d, #bce689);
  right: 0;
}

.Xjstate {
  color: #afadad;
  /* background: #e7e7e7; */
}
</style>
